Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WordPress.com Features: Calypso Locale Sync from Calypso to wp-admin #37352

Merged
merged 10 commits into from
May 15, 2024

Conversation

miksansegundo
Copy link
Contributor

@miksansegundo miksansegundo commented May 13, 2024

Fixes https://github.com/Automattic/dotcom-forge/issues/6812
Related #37316 https://github.com/Automattic/dotcom-forge/issues/7086

Proposed changes:

Note

The masterbar module contains the logic for syncing the Calypso locale in Atomic Default. It's loaded here, only when the navigation redesign flag is disabled.
There is a project in progress that is moving Jetpack Masterbar module to mu-wpcom. See #37277 and read more in pfwV0U-3U-p2

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

Does this pull request change what data or activity we track or use?

Testing instructions:

  • Go to https://wordpress.com/me/account to change Calypso locale
  • Visit any admin page on your atomic site with the nav redesign option flag enabled
  • Verify the Calypso locale appears selected in the dropdown in /wp-admin/profile.php
  • Verify the locale is applied on the whole UI on the first load

Copy link
Contributor

github-actions bot commented May 13, 2024

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WordPress.com Simple site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin, and enable the add/sync-wp-admin-with-calypso-locale branch.

    • For jetpack-mu-wpcom changes, also add define( 'JETPACK_MU_WPCOM_LOAD_VIA_BETA_PLUGIN', true ); to your wp-config.php file.
  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack-mu-wpcom-plugin add/sync-wp-admin-with-calypso-locale
    

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

Copy link
Contributor

github-actions bot commented May 13, 2024

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team Review" label and ask someone from your team review the code. Once reviewed, it can then be merged.
If you need an extra review from someone familiar with the codebase, you can update the labels from "[Status] Needs Team Review" to "[Status] Needs Review", and in that case Jetpack Approvers will do a final review of your PR.


Mu Wpcom plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@DustyReagan
Copy link
Member

I added a4a53f8. I thought that would be the easiest way to collaborate, but please feel free to revert it if needed. I'm just sharing ideas. ☺️

I was able to get syncing working both ways with this commit. By skipping all POST requests and skipping GET requests to profile.php?updated=1, I was able to get locale updates on profile.php using #37316 working again. And by forcing a redirect to the current GET request I was able to refresh the language from a Calypso side sync.

The linter is pretty mad at my commit though 😅, so that needs attention. And we need to consider if this approach is brittle. It needs some more thinking. I'm at EOD, so I'll pass it back to you, @miksansegundo. ☺️

@miksansegundo
Copy link
Contributor Author

I'm testing this again after 1cd341a added the following changes:

  • fix linter
  • name the function and add more comments
  • rename the file to colocate all locale sync logic in the same folder

@miksansegundo miksansegundo changed the title WordPress.com Features: Add wp-admin sync with Calypso locale WordPress.com Features: Calypso Locale Sync from Calypso to wp-admin May 14, 2024
@github-actions github-actions bot added the [Plugin] mu wpcom jetpack-mu-wpcom plugin label May 14, 2024
@miksansegundo miksansegundo force-pushed the add/sync-wp-admin-with-calypso-locale branch from 98186b1 to 95e4b51 Compare May 14, 2024 08:25
@miksansegundo miksansegundo requested a review from mmtr May 14, 2024 12:04
@miksansegundo
Copy link
Contributor Author

I raised D148599-code to add the stubs that may be causing the fails on Tests / Static analysis.

However, the tests on that diff didn't pass. I appreciate help with those tests and the pending linter issue. I followed the guide at p81Rsd-1Pn-p2

@miksansegundo miksansegundo requested review from DustyReagan and removed request for DustyReagan May 14, 2024 12:11
DustyReagan
DustyReagan previously approved these changes May 14, 2024
lupus2k
lupus2k previously approved these changes May 14, 2024
Copy link
Contributor

@lupus2k lupus2k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🎉

@miksansegundo miksansegundo dismissed stale reviews from lupus2k and DustyReagan via 6826e86 May 15, 2024 04:54
@miksansegundo miksansegundo force-pushed the add/sync-wp-admin-with-calypso-locale branch from c949742 to 6826e86 Compare May 15, 2024 04:54
@miksansegundo miksansegundo merged commit 845c939 into trunk May 15, 2024
55 checks passed
@miksansegundo miksansegundo deleted the add/sync-wp-admin-with-calypso-locale branch May 15, 2024 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants